package sing.cloud.alibaba.seata.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sing.cloud.alibaba.seata.mapper.IStorageMapper;
import sing.cloud.alibaba.seata.service.IStorageService;

/**
 * @author xing
 * @date 2022/9/4 14:35
 */
@Service("storageService")
@Slf4j
public class StorageServiceImpl implements IStorageService {

    @Autowired
    private IStorageMapper storageMapper;

    @Override
    public void decrease(Long productId, Integer count) {
        log.info("------->storage-service中扣减库存开始");
        storageMapper.decrease(productId,count);
        log.info("------->storage-service中扣减库存结束");
    }
}
